/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class ListAnotacionData {
	private static final int ROW_COUNT = 100;
	
public void listTestData() throws PersistentException {
		orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
		System.out.println("Listing Tan_alumno...");
		orm.Tan_alumno[] oRMTan_alumnos = lDAOFactory.getTan_alumnoDAO().listTan_alumnoByQuery(null, null);
		int length = Math.min(oRMTan_alumnos.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(oRMTan_alumnos[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Tan_anotacion...");
		orm.Tan_anotacion[] oRMTan_anotacions = lDAOFactory.getTan_anotacionDAO().listTan_anotacionByQuery(null, null);
		length = Math.min(oRMTan_anotacions.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(oRMTan_anotacions[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Tan_curso...");
		orm.Tan_curso[] oRMTan_cursos = lDAOFactory.getTan_cursoDAO().listTan_cursoByQuery(null, null);
		length = Math.min(oRMTan_cursos.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(oRMTan_cursos[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Tan_anotador...");
		orm.Tan_anotador[] oRMTan_anotadors = lDAOFactory.getTan_anotadorDAO().listTan_anotadorByQuery(null, null);
		length = Math.min(oRMTan_anotadors.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(oRMTan_anotadors[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Tan_subsector...");
		orm.Tan_subsector[] oRMTan_subsectors = lDAOFactory.getTan_subsectorDAO().listTan_subsectorByQuery(null, null);
		length = Math.min(oRMTan_subsectors.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(oRMTan_subsectors[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Tan_tipoanotacion...");
		orm.Tan_tipoanotacion[] oRMTan_tipoanotacions = lDAOFactory.getTan_tipoanotacionDAO().listTan_tipoanotacionByQuery(null, null);
		length = Math.min(oRMTan_tipoanotacions.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(oRMTan_tipoanotacions[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
	}
	
	public void listByCriteria() throws PersistentException  {
		System.out.println("Listing Tan_alumno by Criteria...");
		orm.Tan_alumnoCriteria tan_alumnoCriteria = new orm.Tan_alumnoCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//tan_alumnoCriteria.al_id.eq();
		tan_alumnoCriteria.setMaxResults(ROW_COUNT);
		orm.Tan_alumno[] oRMTan_alumnos = tan_alumnoCriteria.listTan_alumno();
		int length =oRMTan_alumnos== null ? 0 : Math.min(oRMTan_alumnos.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(oRMTan_alumnos[i]);
		}
		System.out.println(length + " Tan_alumno record(s) retrieved."); 
		
		System.out.println("Listing Tan_anotacion by Criteria...");
		orm.Tan_anotacionCriteria tan_anotacionCriteria = new orm.Tan_anotacionCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//tan_anotacionCriteria.an_id.eq();
		tan_anotacionCriteria.setMaxResults(ROW_COUNT);
		orm.Tan_anotacion[] oRMTan_anotacions = tan_anotacionCriteria.listTan_anotacion();
		length =oRMTan_anotacions== null ? 0 : Math.min(oRMTan_anotacions.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(oRMTan_anotacions[i]);
		}
		System.out.println(length + " Tan_anotacion record(s) retrieved."); 
		
		System.out.println("Listing Tan_curso by Criteria...");
		orm.Tan_cursoCriteria tan_cursoCriteria = new orm.Tan_cursoCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//tan_cursoCriteria.cur_id.eq();
		tan_cursoCriteria.setMaxResults(ROW_COUNT);
		orm.Tan_curso[] oRMTan_cursos = tan_cursoCriteria.listTan_curso();
		length =oRMTan_cursos== null ? 0 : Math.min(oRMTan_cursos.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(oRMTan_cursos[i]);
		}
		System.out.println(length + " Tan_curso record(s) retrieved."); 
		
		System.out.println("Listing Tan_anotador by Criteria...");
		orm.Tan_anotadorCriteria tan_anotadorCriteria = new orm.Tan_anotadorCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//tan_anotadorCriteria.anot_id.eq();
		tan_anotadorCriteria.setMaxResults(ROW_COUNT);
		orm.Tan_anotador[] oRMTan_anotadors = tan_anotadorCriteria.listTan_anotador();
		length =oRMTan_anotadors== null ? 0 : Math.min(oRMTan_anotadors.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(oRMTan_anotadors[i]);
		}
		System.out.println(length + " Tan_anotador record(s) retrieved."); 
		
		System.out.println("Listing Tan_subsector by Criteria...");
		orm.Tan_subsectorCriteria tan_subsectorCriteria = new orm.Tan_subsectorCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//tan_subsectorCriteria.sub_id.eq();
		tan_subsectorCriteria.setMaxResults(ROW_COUNT);
		orm.Tan_subsector[] oRMTan_subsectors = tan_subsectorCriteria.listTan_subsector();
		length =oRMTan_subsectors== null ? 0 : Math.min(oRMTan_subsectors.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(oRMTan_subsectors[i]);
		}
		System.out.println(length + " Tan_subsector record(s) retrieved."); 
		
		System.out.println("Listing Tan_tipoanotacion by Criteria...");
		orm.Tan_tipoanotacionCriteria tan_tipoanotacionCriteria = new orm.Tan_tipoanotacionCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//tan_tipoanotacionCriteria.ta_id.eq();
		tan_tipoanotacionCriteria.setMaxResults(ROW_COUNT);
		orm.Tan_tipoanotacion[] oRMTan_tipoanotacions = tan_tipoanotacionCriteria.listTan_tipoanotacion();
		length =oRMTan_tipoanotacions== null ? 0 : Math.min(oRMTan_tipoanotacions.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(oRMTan_tipoanotacions[i]);
		}
		System.out.println(length + " Tan_tipoanotacion record(s) retrieved."); 
		
	}
	
	public static void main(String[] args) {
		try {
			ListAnotacionData listAnotacionData = new ListAnotacionData();
			try {
				listAnotacionData.listTestData();
				//listAnotacionData.listByCriteria();
			}
			finally {
				orm.AnotacionPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
